package com.famdoc.Controller;

import com.famdoc.Pojo.dto.HomeFileForm;
import com.famdoc.Pojo.dto.Result;
import com.famdoc.Service.HomeFileService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
public class HomeFileController {
    @Resource
    private HomeFileService homeFileService;

    /**
     * 创建家庭档案
     * @param homeFileForm
     * @return
     */
    @PostMapping("/createHomeFile")
    public Result CreateHomeFile(@RequestBody HomeFileForm homeFileForm){
        return homeFileService.createHomeFile(homeFileForm);
    }

    /**
     * 修改家庭档案
     * @param homeFileForm
     * @return
     */
    @PostMapping("/updateHomeFile")
    public Result updateHomeFile(@RequestBody HomeFileForm homeFileForm){
        return homeFileService.updateHomeFile(homeFileForm);
    }

    /**
     * 查询家庭档案
     * @param idNumber
     * @return
     */
    @GetMapping("/queryHomeFile")
    public Result queryHomeFile(@RequestParam String idNumber){
        return homeFileService.queryHomeFile(idNumber);
    }
}
